package com.jxsr.controller;

import com.alibaba.fastjson.JSONObject;
import com.jxsr.algorithm.LeakyBucketRateLimiter;
import com.jxsr.annotation.IpControl;
import com.jxsr.annotation.Limitation;
import com.jxsr.vo.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * @Description :
 * @Author : Bruce Lee
 * @CreateTime : 2024/12/17
 */

@Slf4j
@RestController
@RequestMapping("/limit")
public class LimitationController {

    @Limitation(time = 60000, count = 5, capacity = 10, rate = 0.1)
//    @IpControl(IpList = "12.12.12.14")
    @RequestMapping("/test")
    public String test(HttpServletRequest request){

        return "test";
    }



}
